diff options
author | Valentin Popov <valentin@popov.link> | 2024-10-03 02:04:27 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-10-03 02:04:27 +0300 |
commit | 2b5302587645dcab7c012c550989b7a8e9bee72b (patch) | |
tree | d0de8fc07cb6d0ec1c81657dcc9f0880a97c4d8b /src/pages/[...page].astro | |
parent | d4eab1ff131c9342213f2dcc9b3c6383c7de41dd (diff) | |
download | popov.link-2b5302587645dcab7c012c550989b7a8e9bee72b.tar.xz popov.link-2b5302587645dcab7c012c550989b7a8e9bee72b.zip |
Update blog post metadata and styles
Diffstat (limited to 'src/pages/[...page].astro')
-rw-r--r-- | src/pages/[...page].astro | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pages/[...page].astro b/src/pages/[...page].astro index cd64d66..6d513b2 100644 --- a/src/pages/[...page].astro +++ b/src/pages/[...page].astro @@ -8,7 +8,10 @@ import PostSummary from "../components/PostSummary.astro"; type Props = InferGetStaticPropsType<typeof getStaticPaths>; export const getStaticPaths = (async ({ paginate }) => { - const posts = await getCollection("blog"); + const posts = await getCollection("blog", ({ data }) => { + return data.draft !== true; + }); + posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); return paginate(posts, { |